package rensoft.gwt.client.event;


public class EventDelegate<Argument> extends
    com.google.web.bindery.event.shared.Event<EventFunction<Argument>> {

  private final Argument argument;
  private final Type<EventFunction<Argument>> event;

  public EventDelegate(Type<EventFunction<Argument>> event, Argument argument) {
    this.event = event;
    this.argument = argument;
  }

  @Override
  public Type<EventFunction<Argument>> getAssociatedType() {
    return event;
  }

  @Override
  protected void dispatch(EventFunction<Argument> handler) {
    handler.run(argument);
  }

}
